//router.js
var url = require('url');
function route(req,res){
	var pathname = url.parse(req.url).pathname;
	if(pathname == "/index"){
		res.writeHead(200,{"Content-Type":"text/html"});
		res.end("This is the index page");
	}else if(pathname == "/page1"){
		res.writeHead(200,{"Content-Type":"text/html"});
		res.end("This is page1");
	}else{
		res.writeHead(200,{"Content-Type":"text/html"});
		res.end("404 Not Fount");
	}
}
exports.route = route;